<html>
<head>
  <style type="text/css">
    body {
      color: #444;
      font-family: Lucida Grande, Lucida Sans Unicode, Lucida Sans, sans-serif;
      font-size: 11px;
      line-height: 18px;
      margin: 0;
      padding: 0;
    }
    form div.line {
      clear: both;
      width: 100%;
      display: block;
      float: left;
      margin: 10px 0;
    }
    label {
      margin-right: 10px;
    }
    .field input {
      width: 300px;
      margin-right: 30px;
    }
    #field-fileupload input {
      width: 205px;
    }
    .field {
      float: left;
    }
    .or {
      float:left;
      font-style:italic;
      margin-bottom:0;
      margin-left:20px;
      margin-right:20px;
      margin-top:0;
      padding-top:2px;
      vertical-align:baseline;
    }
  </style>
<script type="text/javascript">

  function Upload(){
    document.uploadform.submit();
  }
  {% if posted %}
  parent.{{callback}}('{{imagekey}}');
  {% endif %}
</script>
</head>
<body>
    {% if error %}
    <div style="color: red;">{{error}}</div>
    {% endif %}
    <form name="uploadform" id="uploadform" method="post" action="/admin/upload/{{filekey}}/{{callback}}/"  enctype="multipart/form-data">
      <input type="file" multiple name="fileupload[]" id="fileupload" onchange="Upload();" />
      <input type="hidden" name="imagetype" id="imagetype" value="{{imagetype}}" />
    </form>
</body>
</html>